<?php
/**
 * Desc: Service模板
 * User: zdb
 * Date: 2023/6/5
 * Time: 11:22
 */
namespace app\api\service\system;
use app\api\model\system\SystemSettingModel;

class SystemSettingService
{
    private $relateModel;
    public function __construct()
    {
        $this->relateModel = new SystemSettingModel();
    }

    public function getSystemSettingList($data)
    {
        $model = $this->relateModel;
        return $model->insertOne($data);
    }

    public function getSystemSettingOption($data)
    {
        $model = $this->relateModel;
        return $model->insertOne($data);
    }

    public function getSystemSettingInfoById($id)
    {
        $model = $this->relateModel;
        return $model->findOneById($id);
    }

    public function getSystemSettingInfoByCondition($condition)
    {
        $model = $this->relateModel;
        return $model->findOneByCondition($condition);
    }

    public function getSystemSettingDetailById($data)
    {
        $model = $this->relateModel;
        return $model->insertOne($data);
    }

    public function getSystemSettingTotalNum($data)
    {
        $model = $this->relateModel;
        return $model->getTotalNum($data);
    }

    public function addSystemSetting($data)
    {
        $model = $this->relateModel;
        return $model->insertOne($data);
    }

    public function editSystemSettingById($id, $data)
    {
        $model = $this->relateModel;
        return $model->updateOneById($id, $data);
    }

    public function editSystemSettingByManyId($arrId, $data)
    {
        $model = $this->relateModel;
        return $model->updateListByManyId($arrId, $data);
    }

    public function deleteSystemSettingById($id)
    {
        $model = $this->relateModel;
        return $model->removeOneById($id);
    }

    public function deleteSystemSettingByManyId($arrId)
    {
        $model = $this->relateModel;
        return $model->removeListByManyId($arrId);
    }
}
